package com.hexiaohe.springboot_vue_app.controller;

import com.hexiaohe.springboot_vue_app.entity.Role;
import com.hexiaohe.springboot_vue_app.service.RoleService;
import com.hexiaohe.springboot_vue_app.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/role")
public class RoleController {
    @Autowired
    RoleService roleService;
    @RequestMapping("/getAllRoles")
    public Result<?>getAllRoles(){
        System.out.println("roles");
        List<Role> roles =roleService.getAllRoles();
        return Result.success(roles);
    }
}
